#include <cstdio>
#include <algorithm>
using namespace std;
#define LL long long
#define ULL unsigned long long

const int N = 1e5+10;
int n;
struct node
{
    int val, cnt;
    bool operator<(const node& dst) const
    {
        return val < dst.val;
    }
}a[N];
int cnt, b[N];

inline void init()
{
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
    {
        int x; scanf("%d", &x);
        if (!b[x]) b[x] = ++cnt, a[cnt].val = x;
        a[b[x]].cnt++;
    }

    sort(a+1, a + 1 + cnt);
}

inline void solve()
{
    int eaten = 0;
    int sum = a[1].cnt;
    for (int i = 2; i <= cnt; i++)
    {
        eaten += min(sum, a[i].cnt);
        sum -= min(sum, a[i].cnt);
        sum += a[i].cnt;
    }
    printf("%d\n", n - eaten);
}

int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    init();
    solve();

    return 0;
}